for i =1:rows
    for j =1:cols
       x(i,j) = i;
       y(i,j) = j;
    end
end    